<template>
  <div class="risk-compliance c-shadow">
    <div class="judgment">
      <h4 class="detail-base-title">经营异常<span>{{total || 0}}</span></h4>
      <j-no-data v-if="manageData.length === 0" :mode="'b'" msg="b"></j-no-data>
      <div class="table-wrap" v-else>
        <table>
          <thead>
            <tr>
              <th v-for="title in manage" :key="title">{{title}}</th>
            </tr>
          </thead>
          <tbody>
            <tr v-for="item in manageData" :key="item.manage">
              <td>{{item.inputDate | dateFormat}}</td>
              <td :title="item.inputReason">{{item.inputReason || '--'}}</td>
              <td>{{item.inputOrganization || '--'}}</td>
            </tr>
          </tbody>
        </table>
        
     <div class="block paging-wrap fr">
        <el-pagination v-if="total>5"
          @size-change="handleSizeChange"
          @current-change="handleCurrentChange"
          :current-page.sync="pageNum"
          :page-size="pageSize"
          layout="prev, pager, next, jumper"
          :total="total">
        </el-pagination>
      </div>
      </div>
    </div>
  </div>
</template>
<script>
import { jNoData } from '../../components'
import { sysSetting as api } from '../../api'
export default {
  data() {
    return {
      manage: ['列入日期', '列入原因', '决定机关'],
      manageData: [
      ],
      params: {},
      pageNum: 1,
      pageSize: 5,
      total: 0
    }
  },
  mounted() {
    this.params.entName = this.$route.query.entname
    this.getbusinessList()
  },
  methods: {
    // 获取税务处罚
    getbusinessList() {
      let _this = this
      let params = {
        pageNum: _this.pageNum,
        pageSize: _this.pageSize
      }
      api
        .getbusinessList({..._this.params, ...params})
        .then(rtn => {
          _this.manageData = rtn.data.list
          _this.total = rtn.data.total
        })
        .catch(err => {
          _this.pageState = err
        })
    },
    handleSizeChange() {
      // 当pagesize改变的时候出发该函数
    },
    handleCurrentChange(index) {
      this.pageNum = index
      this.getbusinessList()
    }
  },
  components: {
    jNoData
  }
}
</script>
<style lang="scss" scoped>
.risk-compliance {
  padding: 28px 40px;
  font-size: 14px;
  .detail-base-title {
    line-height: 30px;
    font-size: 16px;
    font-weight: bold;
    padding: 30px 0 0 12px;
    position: relative;
    background-image: linear-gradient(0deg,#1891ef,#1891ef);
    background-size: 3px 16px;
    background-position: 0 37px;
    background-repeat: no-repeat;
    border-bottom: 1px solid #eee;
  }
  h4.detail-base-title span {
    border: 1px solid #9dc5fd;
    border-radius: 10px;
    color: #1688f3;
    background: #f2f7ff;
    font-size: 12px;
    padding: 0 10px;
    margin-left: 15px;
    vertical-align: top;
  }
  .table-wrap {
    padding: 30px 20px;
    table {
      border-collapse: collapse;
      width: 100%;
      text-align: center;
      td,
      th {
        border: 1px solid #e2e2e2;
        line-height: 40px;
      }
      th {
        line-height: 38px;
        color: #999;
        background: #f2f1f1;
      }
      td {
        padding: 0 10px;
      }
    }
  }
}
</style>



// WEBPACK FOOTER //
// src/view/entDetail/riskManagement.vue